package com.spdb.spdbfl.database;

import com.mysql.jdbc.StringUtils;
import com.spdb.spdbfl.utils.ConfigProperty;

public class DBInfo {
    public DBInfo() {
    }

    public static String getConn() {
        String conn = "jdbc:mysql://10.116.2.244:3306/puyin?user=puyin&password=Jason71419831224Wb";
        String runMode = ConfigProperty.getProperty("runmode");
        if (!StringUtils.isNullOrEmpty(runMode) && runMode.toLowerCase().startsWith("test")) {
            conn = "jdbc:mysql://10.116.2.244:3306/puyin?user=puyin&password=Jason71419831224Wb";
        }

        System.out.println(conn);
        return conn;
    }

    public static String getConn(String connkey){
        String dbConn = ConfigProperty.getProperty(connkey);
        System.out.println(dbConn);
        return dbConn;
    }

}
